<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    <title>教学日历</title>
    <%@include file="../common/common.jsp" %>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	

  </head>
  
  <body>
  	<form class="form-inline definewidth m20" action="process/queryCalendar.do" method="post">    
	    课程号：
	    <input type="text" name="course_name" id="course_name" class="abc input-default" placeholder="支持模糊查询" value="${param.course_name }">&nbsp;&nbsp;  
	    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; 
	    <button type="button" class="btn btn-success" id="addnew">新增</button>
	</form>
	<table class="table table-bordered table-hover definewidth m10">
	    <thead>
		    <tr>
		    	<th>&nbsp;</th>
		        <th>序号</th>
		        <th>课程号</th>
		        <th>课程名</th>
		        <th>课程种类</th>
		        <th>行政班</th>
		        <th>教师</th>
		        <th>实际</th>
		        <th>上限</th>
		        <th>学时</th>
		        <th>学分</th>
		        <th>起始周</th>
		        <th>考核方式</th>
		        <th>任务类型</th>
<!-- 		        <th>日历状态</th> -->
		        <th>操作</th>
		    </tr>
	    </thead>
		<tbody>
			<c:forEach items="${list }" var="info">
				<tr>
		            <td><label><input type="checkbox" /></label></td>
					<td>${info.seq}</td>		
					<td>${info.course_name}</td>	
					<td>${info.course_num}</td>	
					<td>${info.course_type}</td>	
					<td>${info.xz_class}</td>	
					<td>${info.teacher_id}</td>	
					<td>${info.fact}</td>
					<td>${info.upper_limit}</td>
					<td>${info.class_hour}</td>
					<td>${info.credit_hour}</td>
					<td>${info.week}</td>	
					<td>
						<c:if test="${info.check_type eq 1}">考查</c:if>
						<c:if test="${info.check_type eq 2}">考试</c:if>
					</td>
					<td>
						<c:if test="${info.task_type eq 1}">陆上任务</c:if>
						<c:if test="${info.task_type eq 2}">海上任务</c:if>
					</td>
<!-- 					<td>${info.status}</td> -->
					<td>
						<a href="javascript:void(0)" onclick="queryDetail('${info.id}','${info.course_name }')">查看日历</a>&nbsp;
						<a href="javascript:void(0)" onclick="addDetail('${info.id}')">新增日历</a>
					</td>
		        </tr>
			</c:forEach>
		</tbody>	
	</table>
  </body>
  <script type="text/javascript">
  	$(function (){
  		$("#addnew").click(function (){
  			window.location.href="<%=basePath%>/process/toEditCalendar.do?action=add";
  		});
  	});
  	
  	function addDetail(id){
  		window.location.href="<%=basePath%>process/calendarDetailEdit.jsp?action=add&calendar_id="+id;
  	}
  	function queryDetail(id,course_name){
  		window.location.href="<%=basePath%>/process/queryCalendarDetail.do?calendar_id="+id+"&course_name="+course_name;
  	}
  </script>
</html>
